package com.fivetiger.service.impl;

import com.fivetiger.dao.RaiseDao;
import com.fivetiger.entity.Raise;
import com.fivetiger.service.inte.RaiseService;
import com.fivetiger.util.RUtil;
import com.fivetiger.vo.PageBean;
import com.fivetiger.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @date 2021/6/17 - 20:09
 */

@Service
public class RaiseServiceImpl implements RaiseService {
    @Autowired
    private RaiseDao dao;

    //新增
    @Override
    public R save(Raise raise) {
        if(dao.insert(raise)>0){
            //成功
            return RUtil.ok();
        }else {
            //失败
            return RUtil.fail();
        }
    }

    //查询
    @Override
    public PageBean queryList() {
        List<Raise> list=dao.selectAll();
        return new PageBean(0,"",list.size(),list);
    }
}
